﻿namespace WPFDBBrowser.MessageBus
{
    using System;

    public interface IMessageBus
    {
        IEndPoint RegisterEndpoint(string address);
        void UnRegisterEndpoint(string address);
        IEndPoint Start(string address);
        IEndPoint Stop(string address);
        IEndPoint Publish<TMessage>(string publisher, TMessage message);
        IEndPoint Subscribe<TMessage>(string subscriber, Guid subscriptionId, Action<TMessage> notify);
        IEndPoint Subscribe<TMessage>(string subscriber, Guid subscriptionId, Action<TMessage> notify, Predicate<TMessage> filter);
        IEndPoint Send<TMessage>(string sender, TMessage message, string recipient);
        IEndPoint Send<TRequest, TResponse>(string sender, TRequest request, string recipient, Action<TResponse> reply);
        IEndPoint UnSubscribe(Guid subscriptionId);

    }
}
